home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2006 May / PCWMAY06.iso / Software / Freeware / First Page 2006 3.00 / fp2006-final-3.00-setup.exe / {app} / Iscripts / Message Dialogs / customizable-js-prompt.izs < prev    next >
Text File  |  2005-09-28  |  9KB  |  297 lines

  1. <!NOWIZARD>
  2.  
  3. <!TITLE>Customizable JavaScript Prompt 
  4.  
  5. <!/TITLE>
  6.  
  7. <!DESCRIPTION> This script is used to generate a customized prompt box. With the use of a timer function you can generate it automatically.
  8. <!/DESCRIPTION> 
  9.  
  10. <!CATEGORY>Messages<!/CATEGORY>
  11.  
  12. <!SCRIPT>
  13. <!-- START OF SCRIPT -->
  14.  
  15.  
  16.  
  17. <!-- HOW TO INSTALL CUSTOMIZABLE JAVASCRIPT PROMPT:
  18.  
  19.  
  20.  
  21.   1.  Copy code into the HEAD section of document
  22.  
  23.   2.  Put last coding into the BODY section of document  -->
  24.  
  25.  
  26.  
  27. <!-- STEP ONE: Add code into HEAD section of document  -->
  28.  
  29.  
  30.  
  31. <HEAD>
  32.  
  33.  
  34.  
  35. <!-- Original:  Mukesh/Ritesh (mukesh@netedgecomputing.com) -->
  36.  
  37. <!-- Web Site:  http://www.netedgecomputing.com -->
  38.  
  39.         <style type="text/css">
  40.  
  41.         <!--/*************************** below code can be in a css file  *****************************/-->
  42.  
  43.             input.prompt {border:1 solid transparent; background-color:#99ccff;width:70;font-family:arial;font-size:12; color:black;} 
  44.  
  45.             td.titlebar { background-color:#FF9F40; color:#0000D2; font-weight:bold;font-family:arial; font-size:12;} 
  46.  
  47.             table.promptbox {border:1 solid #ccccff; background-color:#FFFFE6; color:black;padding-left:2;padding-right:2;padding-bottom:2;font-family:arial; font-size:12;} 
  48.  
  49.             input.promptbox {border:1 solid #0000FF; background-color:white;width:100%;font-family:arial;font-size:12; color:black; }
  50.  
  51.         <!--/*************************** end  css file  *****************************/-->
  52.  
  53.             
  54.  
  55.         </style>
  56.  
  57.         
  58.  
  59.         <script language='javascript'>
  60.  
  61.         
  62.  
  63.         /*************************** below code can be in a js file  *****************************/
  64.  
  65.         var response = null 
  66.  
  67.             
  68.  
  69.             function prompt2(promptpicture, prompttitle, message, sendto) { 
  70.  
  71.                 promptbox = document.createElement('div'); 
  72.  
  73.                 promptbox.setAttribute ('id' , 'prompt') 
  74.  
  75.                     document.getElementsByTagName('body')[0].appendChild(promptbox) 
  76.  
  77.                     promptbox = eval("document.getElementById('prompt').style") 
  78.  
  79.                     promptbox.position = 'absolute' 
  80.  
  81.                     promptbox.top = 100 
  82.  
  83.                     promptbox.left = 200 
  84.  
  85.                     promptbox.width = 300 
  86.  
  87.                     promptbox.border = 'outset 1 #bbbbbb' 
  88.  
  89.                     document.getElementById('prompt').innerHTML = "<table cellspacing='0' cellpadding='0' border='0' width='100%'><tr valign='middle'><td width='22' height='22' style='text-indent:2;' class='titlebar'><img src='" + promptpicture + "' height='18' width='18'></td><td class='titlebar'>" + prompttitle + "</td></tr></table>" 
  90.  
  91.                     document.getElementById('prompt').innerHTML = document.getElementById('prompt').innerHTML + "<table cellspacing='0' cellpadding='0' border='0' width='100%' class='promptbox'><tr><td>" + message + "</td></tr><tr><td><input type='text' id='promptbox' onblur='this.focus()' class='promptbox'></td></tr><tr><td align='right'><br><input type='button' class='prompt' value='OK' onMouseOver='this.style.border=\"1 outset #dddddd\"' onMouseOut='this.style.border=\"1 solid transparent\"' onClick='" + sendto + "(document.getElementById(\"promptbox\").value); document.getElementsByTagName(\"body\")[0].removeChild(document.getElementById(\"prompt\"))'> <input type='button' class='prompt' value='Cancel' onMouseOver='this.style.border=\"1 outset transparent\"' onMouseOut='this.style.border=\"1 solid transparent\"' onClick='" + sendto + "(\"\"); document.getElementsByTagName(\"body\")[0].removeChild(document.getElementById(\"prompt\"))'></td></tr></table>" 
  92.  
  93.                     document.getElementById("promptbox").focus() 
  94.  
  95.                 } 
  96.  
  97.         function myfunction(value) { 
  98.  
  99.             if(value.length<=0)
  100.  
  101.                 
  102.  
  103.                 return false;
  104.  
  105.             else
  106.  
  107.                 document.getElementById('output').innerHTML="<b>"+value+"</b>";
  108.  
  109.         } 
  110.  
  111.         
  112.  
  113.         /***************************  js file code *****************************/
  114.  
  115.         </script>
  116.  
  117.         <SCRIPT LANGUAGE="JavaScript">
  118.  
  119.         <!--
  120.  
  121.         function callPrompt(){
  122.  
  123.             prompt2('btn1p.gif', 'My Prompt','Please enter your name ,if you want to chat with our <B>customer support executive</B>', 'myfunction');
  124.  
  125.         }
  126.  
  127.         //-->
  128.  
  129.         </SCRIPT>
  130.  
  131. </HEAD>
  132.  
  133.  
  134.  
  135. <!-- STEP TWO: Add code into BODY section of document  -->
  136.  
  137.  
  138.  
  139. <BODY>
  140.  
  141.  
  142. <!-- Original:  Mukesh/Ritesh (mukesh@netedgecomputing.com) -->
  143.  
  144. <!-- Web Site:  http://www.netedgecomputing.com -->
  145.  
  146.             <input type="button" value='show prompt' onClick="callPrompt()"> </CENTER>
  147.  
  148.         <div id="output" style="position:absolute;background-color:#FFFFCC;width:200;height:50;left:300;top:150;border:1 solid #FF8000;color:#0000F2"></div>
  149.  
  150.  
  151. <!-- END OF SCRIPT -->
  152. <!/SCRIPT>
  153.  
  154. <!PREVIEW>
  155. <!-- START OF SCRIPT -->
  156.  
  157.  
  158. <!-- HOW TO INSTALL CUSTOMIZABLE JAVASCRIPT PROMPT:
  159.  
  160.  
  161.  
  162.   1.  Copy code into the HEAD section of document
  163.  
  164.   2.  Put last coding into the BODY section of document  -->
  165.  
  166.  
  167.  
  168. <!-- STEP ONE: Add code into HEAD section of document  -->
  169.  
  170.  
  171.  
  172. <HEAD>
  173.  
  174.  
  175.  
  176. <!-- Original:  Mukesh/Ritesh (mukesh@netedgecomputing.com) -->
  177.  
  178. <!-- Web Site:  http://www.netedgecomputing.com -->
  179.  
  180.         <style type="text/css">
  181.  
  182.         <!--/*************************** below code can be in a css file  *****************************/-->
  183.  
  184.             input.prompt {border:1 solid transparent; background-color:#99ccff;width:70;font-family:arial;font-size:12; color:black;} 
  185.  
  186.             td.titlebar { background-color:#FF9F40; color:#0000D2; font-weight:bold;font-family:arial; font-size:12;} 
  187.  
  188.             table.promptbox {border:1 solid #ccccff; background-color:#FFFFE6; color:black;padding-left:2;padding-right:2;padding-bottom:2;font-family:arial; font-size:12;} 
  189.  
  190.             input.promptbox {border:1 solid #0000FF; background-color:white;width:100%;font-family:arial;font-size:12; color:black; }
  191.  
  192.         <!--/*************************** end  css file  *****************************/-->
  193.  
  194.             
  195.  
  196.         </style>
  197.  
  198.         
  199.  
  200.         <script language='javascript'>
  201.  
  202.         
  203.  
  204.         /*************************** below code can be in a js file  *****************************/
  205.  
  206.         var response = null 
  207.  
  208.             
  209.  
  210.             function prompt2(promptpicture, prompttitle, message, sendto) { 
  211.  
  212.                 promptbox = document.createElement('div'); 
  213.  
  214.                 promptbox.setAttribute ('id' , 'prompt') 
  215.  
  216.                     document.getElementsByTagName('body')[0].appendChild(promptbox) 
  217.  
  218.                     promptbox = eval("document.getElementById('prompt').style") 
  219.  
  220.                     promptbox.position = 'absolute' 
  221.  
  222.                     promptbox.top = 100 
  223.  
  224.                     promptbox.left = 200 
  225.  
  226.                     promptbox.width = 300 
  227.  
  228.                     promptbox.border = 'outset 1 #bbbbbb' 
  229.  
  230.                     document.getElementById('prompt').innerHTML = "<table cellspacing='0' cellpadding='0' border='0' width='100%'><tr valign='middle'><td width='22' height='22' style='text-indent:2;' class='titlebar'><img src='" + promptpicture + "' height='18' width='18'></td><td class='titlebar'>" + prompttitle + "</td></tr></table>" 
  231.  
  232.                     document.getElementById('prompt').innerHTML = document.getElementById('prompt').innerHTML + "<table cellspacing='0' cellpadding='0' border='0' width='100%' class='promptbox'><tr><td>" + message + "</td></tr><tr><td><input type='text' id='promptbox' onblur='this.focus()' class='promptbox'></td></tr><tr><td align='right'><br><input type='button' class='prompt' value='OK' onMouseOver='this.style.border=\"1 outset #dddddd\"' onMouseOut='this.style.border=\"1 solid transparent\"' onClick='" + sendto + "(document.getElementById(\"promptbox\").value); document.getElementsByTagName(\"body\")[0].removeChild(document.getElementById(\"prompt\"))'> <input type='button' class='prompt' value='Cancel' onMouseOver='this.style.border=\"1 outset transparent\"' onMouseOut='this.style.border=\"1 solid transparent\"' onClick='" + sendto + "(\"\"); document.getElementsByTagName(\"body\")[0].removeChild(document.getElementById(\"prompt\"))'></td></tr></table>" 
  233.  
  234.                     document.getElementById("promptbox").focus() 
  235.  
  236.                 } 
  237.  
  238.         function myfunction(value) { 
  239.  
  240.             if(value.length<=0)
  241.  
  242.                 
  243.  
  244.                 return false;
  245.  
  246.             else
  247.  
  248.                 document.getElementById('output').innerHTML="<b>"+value+"</b>";
  249.  
  250.         } 
  251.  
  252.         
  253.  
  254.         /***************************  js file code *****************************/
  255.  
  256.         </script>
  257.  
  258.         <SCRIPT LANGUAGE="JavaScript">
  259.  
  260.         <!--
  261.  
  262.         function callPrompt(){
  263.  
  264.             prompt2('btn1p.gif', 'My Prompt','Please enter your name ,if you want to chat with our <B>customer support executive</B>', 'myfunction');
  265.  
  266.         }
  267.  
  268.         //-->
  269.  
  270.         </SCRIPT>
  271.  
  272. </HEAD>
  273.  
  274.  
  275.  
  276. <!-- STEP TWO: Add code into BODY section of document  -->
  277.  
  278.  
  279.  
  280. <BODY>
  281.  
  282.  
  283. <!-- Original:  Mukesh/Ritesh (mukesh@netedgecomputing.com) -->
  284.  
  285. <!-- Web Site:  http://www.netedgecomputing.com -->
  286.  
  287.             <input type="button" value='show prompt' onClick="callPrompt()"> </CENTER>
  288.  
  289.         <div id="output" style="position:absolute;background-color:#FFFFCC;width:200;height:50;left:300;top:150;border:1 solid #FF8000;color:#0000F2"></div>
  290.  
  291.  
  292.  
  293. <!-- END OF SCRIPT -->
  294. <!/PREVIEW>
  295.  
  296. <!RELATED>NONE<!/RELATED>
  297.